package com.geektime.customer.rest;

import com.geektime.customer.service.DruidDemoService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/druid")
public class DruidDemoController {

    private final DruidDemoService druidDemoService;

    @GetMapping(value = "/demo01")
    public ResponseEntity<Object> demo01() throws Exception {
        return new ResponseEntity<>(druidDemoService.demo1(), HttpStatus.OK);
    }


    @GetMapping(value = "/demo02")
    public ResponseEntity<Object> demo02() throws Exception {
        return new ResponseEntity<>(druidDemoService.demo2(), HttpStatus.OK);
    }


    @GetMapping(value = "/demo03")
    public ResponseEntity<Object> demo3() throws Exception {
        return new ResponseEntity<>(druidDemoService.demo3(), HttpStatus.OK);
    }

    @GetMapping(value = "/demo04")
    public ResponseEntity<Object> demo04() throws Exception {
        return new ResponseEntity<>(druidDemoService.demo4(), HttpStatus.OK);
    }

}
